<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="Dao.*"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Entity.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>下载精品课程</title>
</head>
<body>
<%
String currentUserNo="";
if(session.getAttribute("session_userName")!=null){
	currentUserNo=session.getAttribute("session_userName").toString();
}
else if(session.getAttribute("session_admin")!=null){
	currentUserNo=session.getAttribute("session_admin").toString();
}
%>
	<link href="css/downloadExcellentCourse.css" rel="stylesheet"
		type="text/css" />
	<jsp:useBean id="CourseResourceDao" class="Dao.CourseResourceDao"></jsp:useBean>
	<div class="header">
		<h1>
			&emsp;&emsp;&emsp;
			<%=request.getParameter("label")%></h1>
	</div>
	<div class="body">
		<table class="dataintable">
			<tr>
				<td align="center">课程ID</td>
				<td align="center">标签</td>
				<td align="center">课程名称</td>
				<td align="center">上传者ID</td>
				<td align="center">上传时间</td>
				<td align="center">简要介绍</td>
				<td align="center">下载</td>
			</tr>
			<%
				String label = request.getParameter("label");
				List<CourseResource> crlist = CourseResourceDao.queryCourseResourceByLabel(label);
				for (CourseResource cr : crlist) {
			%>
			<tr>
				<td><input type="text" value=<%=cr.getCourseID()%>></td>
				<td><input type="text" value=<%=cr.getLabel()%>></td>
				<td><input type="text" value=<%=cr.getCourseName()%>></td>
				<td><input type="text" value=<%=cr.getUploaderID()%>></td>
				<td><input type="text" value=<%=cr.getUploadTime()%>></td>
				<td><input type="text" value=<%=cr.getBriefIntroduce()%>></td>
				<td><a
					href="/UniversityResourceSystem/SmartDownloadServlet?uploader=<%=cr.getUploaderID()%>&&fileName=<%=cr.getCourseName()%>
					&&studentNo=<%=currentUserNo %>&&courseID=<%=cr.getCourseID() %> "
					style="text-decoration: none">下载</a></td>
			</tr>
			<%
				}
			%>
		</table>
	</div>
       <div class="foot">
				<font color="white">Made by Aaron</font>		
		</div>


</body>
</html>